package cn.xhjava.crm.workbench.service.impl;

import cn.xhjava.crm.workbench.domain.ContactsRemark;
import cn.xhjava.crm.workbench.mapper.ContactsRemarkMapper;
import cn.xhjava.crm.workbench.service.ContactsRemarkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Xiahu
 * @create 2023/7/14 0014
 */
@Service
public class ContactsRemarkServiceImpl implements ContactsRemarkService {
    @Autowired
    private ContactsRemarkMapper remarkMapper;

    @Override
    public List<ContactsRemark> selectContactsRemarkByContactsId(String id) throws Exception {
        return remarkMapper.queryContactsRemarkForDetailByContactsId(id);
    }

    @Override
    public int add(ContactsRemark remark) throws Exception {
        return remarkMapper.insert(remark);
    }

    @Override
    public int delete(String id) throws Exception {
        return remarkMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int update(ContactsRemark remark) throws Exception {
        return remarkMapper.updateByPrimaryKeySelective(remark);
    }
}